﻿@using rentit03_client.Models
<div class="movies">
    @for (var i = 0; i < ViewBag.Media.Count; i++)
    {
        MovieObj media = ViewBag.Media[i];
        <div class="row" style="margin-bottom: 20px">
            <div class="span2">
                @{ var src = (media.CoverUrl == null || media.CoverUrl.Equals("N/A")) ? "http://placehold.it/140x200" : media.CoverUrl; }
                <a href="@Url.Action("Index", "Movie", new { @id = media.Id })">
                    <img class="poster" src="@src" alt="@media.Title">
                </a>
            </div>
            <div class="span7">
                <div class="page-header" style="padding-bottom: 5px">
                    <h2>
                        &#35;@(i + 1 + (ViewBag.Pager.Current - 1) * ViewBag.Pager.Count):
                        @media.Title</h2>
                </div>
                <div class="row" style="margin-bottom: 10px">
                    <div class="rating progress progress-warning span2 bottom" rel="tooltip" data-original-title="@media.Rating">
                        <div class="bar" style="width: @((int)(media.Rating * 10))%">
                        </div>
                    </div>
                    <div class="span4">
                        IMDb ratings: <strong>@media.Rating</strong>/10 from @media.Votes users
                    </div>
                </div>
                <blockquote>
                    <p>@media.Description</p>
                </blockquote>
            </div>
        </div>
    }
    @Html.Partial("_Pager")
</div>